package com.xin.springclouduser.repository;

import com.xin.springclouduser.dataobject.MyFriend;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface MyFriendRepository extends JpaRepository<MyFriend,String> {
    //查询好友列表 不管是uid 还是 fid，只要包含本人id,就是好友
    Page<MyFriend> findAllByUidOrFid(String uid, String fid,Pageable pageable);
    //查询是否为好友,需要查询两次
    MyFriend findByUidAndFid(String uid,String fid);
}
